<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>01_定义整体结构</title>

  <!-- 调用自己封装的 Promise -->
  <script src="../Promise_js/01_Promise.js"></script>
</head>
<body>
  
  <script>
    let p = new Promise( (resolve, reject) => {
      resolve('ok')
    });

    /** 1.
     * 传入参数
     * (resolve, reject) => { resolve('ok') } => executor
     * 
    */



    p.then(value => {
      console.log(value)
    }, reason => {
      console.warn(reason);
    })



    /** 3.
     * p.then
     * 调用, 并传递参数
     * (onResult, onRejected) { }
     * (value) => { console.log(value) }    =>  onResult
     * (reason) => { console.log(reason) }  =>  onRejected
    */




  </script>

</body>
</html>